<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Connection"%>
<%@ page contentType="text/html; charset=utf-8" 
pageEncoding="utf-8" %>
<%
	String DRV = "org.mariadb.jdbc.Driver";
	String URL = "jdbc:mariadb://localhost:3306/siestageek?user=siestageek&password=987654";
	String SQL = "select * from memberv4 where uid = ?";
	Connection conn = null;
	PreparedStatement pstmt = null;
	ResultSet rs = null;
%>
<%
	String mno = null;
	String uid = request.getParameter("uid");
	String pwd = null;
	String name = null;
	String rdate = null;
%>
<%
	try {
		Class.forName(DRV);
		conn = DriverManager.getConnection(URL);
		pstmt = conn.prepareStatement(SQL);
			pstmt.setString(1, uid);
		rs = pstmt.executeQuery();
		if ( rs.next() ) {
			mno = rs.getString(1);
			pwd = rs.getString(3);
			name = rs.getString(4);
			rdate = rs.getString(5);
		}
	} catch (Exception ex) {
		ex.printStackTrace();
	} finally {
		if (rs != null) try { rs.close(); } catch (Exception e) {}
		if (pstmt != null) try { pstmt.close(); } catch (Exception e) {}
		if (conn != null) try { conn.close(); } catch (Exception e) {}
	}
%>
<!DOCTYPE html>
<html lang="ko">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>JSP 프로젝트 v1</title>
		<link type="text/css" href="../css/layout.css"
			rel="stylesheet" />
		<style type="text/css">
		</style>
	</head>

	<body>
		<div>
			<h1>JSP 프로젝트 v1</h1><!-- 제목 -->
			<ul id="nav">
				<li><a href="../index.html">Home</a></li>
				<li><a href="join.html">회원가입</a></li>
				<li><a href="login.html">로그인</a></li>
				<li><a href="../board/list.html">게시판</a></li>
				<li><a href="myinfo.html">회원정보</a></li>
			</ul>	<!-- 상단메뉴 -->
			<hr />
		</div><!-- // header -->
		<div id="content">
			<h2>회원정보</h2>
			<p>회원번호 : <%=mno %></p>
			<p>아이디 : <%=uid %></p>
			<p>비밀번호 : <%=pwd %></p>
			<p>이름 : <%=name %></p>
			<p>가입일 : <%=rdate %></p>
		</div><!-- // content -->
		<div>
			<hr />
			<p id="copy">copyrights(c) 2013. siestageek. 
				all rights reserved.</p>
		</div><!-- // footer -->
	</body>
</html>




